import { nullPostLogin } from '@/api/profile'
export default {
  // 命名空间
  namespaced: true,
  state: {
    profile: null
  },
  getters: {},
  mutations: {
    getprofile (state, plyod) {
      // console.log(plyod)
      state.profile = plyod
    }
  },
  actions: {
    async postlogin (store, plyod) {
      const res = await nullPostLogin(plyod)
      // console.log(res)
      store.commit('getprofile', res.result)
      uni.showToast({ title: '登录成功' })
      setTimeout(() => {
        uni.navigateBack()
      }, 1000)
    }
  }
}
